package com.common.tree;

import java.util.ArrayList;
import java.util.List;

public class Tree {
    private String label;
    private String value;

    public void add(Tree tree) {
        if (children == null) {
            children = new ArrayList<>();
        }
        this.children.add(tree);
    }

    public Tree(String label, String value) {
        this.label = label;
        this.value = value;
    }

    private List<Tree> children;

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public List<Tree> getChildren() {
        return children;
    }

    public void setChildren(List<Tree> children) {
        this.children = children;
    }
}
